import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '/index',
        name: 'Index',
        component: () => import('../views/index/Index.vue'),
      },
      {
        path: '/follow',
        name: 'Follow',
        component: () => import('../views/follow/Follow.vue'),
      },
      {
        path: '/me',
        name: 'Me',
        component: () => import('../views/me/me.vue'),
      },
      {
        path: '/msg',
        name: 'Msg',
        component: () => import('../views/msg/msg.vue'),
      },
    ],
  },
  {
    path: '/sign',
    name: 'Sign',
    component: () => import('../views/Sign.vue'),
  },
  {
    path: '/tpsign',
    name: 'Tpsign',
    component: () => import('../views/tpsign.vue'),
  },
  {
    path: '/toast',
    name: 'Toast',
    component: () => import('../components/toast/toast.vue'),
  },
  {
    path: '/edit',
    name: 'Edit',
    component: () => import('../views/me/edit.vue'),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
